
//var JPush = require("../lib/JPush/JPush.js");
var JPush = require("jpush-sdk");
var client = JPush.buildClient('d48246900664b58979af1385', '4183168f00c436d683b58c2f');


module.exports = function (app) {

    // pinpp回调
    app.get('/jpush', function (req, res, next) {

        //easy push
        client.push().setPlatform(JPush.ALL)
            .setAudience(JPush.ALL)
            .setNotification('Hi, JPush', JPush.ios('ios alert', 'happy.caf', 5))
            .send(function(err, res) {
                if (err) {
                    console.log(err.message);
                } else {
                    console.log('Sendno: ' + res.sendno);
                    console.log('Msg_id: ' + res.msg_id);
                }
            });

        res.send("发送成功！");

    });
};



